//============================================================================
// Copyright (C) 2009-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================

#include "RcSktLib.h"
#include <VxUtilLib/VxSktUtil.h>
#include <VxUtilLib/VxParse.h>

/*
//============================================================================
// implements a manager to manage accept sockets
//============================================================================
//============================================================================
//=== Declaration of functions used only in this file ===//
//============================================================================
//! thread function to listen for connections
static U32 SktAcceptMgrThreadFunc(  void * pvContext );
*/

int RcSktAcceptMgr::m_iAcceptMgrCnt = 0;				// number of accept managers that have been created

//============================================================================
//=== constructor ===//
RcSktAcceptMgr::RcSktAcceptMgr()
 : VxSktAcceptMgr()
{
	m_iAcceptMgrCnt++;
	m_iMgrId = m_iAcceptMgrCnt;
	m_eSktMgrType = eSktMgrTypeTcpAccept;
}

//============================================================================
//=== destructor ===//
RcSktAcceptMgr::~RcSktAcceptMgr()
{
	stopListening();
	if( m_aoSktsToDelete.size()  )
	{
		unsigned int iCnt = m_aoSktsToDelete.size();
		for( unsigned int i = 0; i < iCnt; i++ )
		{
			delete m_aoSktsToDelete[i];
		}
	}
}

//============================================================================
VxSktBase * RcSktAcceptMgr::makeNewSkt( void )				
{ 
	return new RcSktAccept(); 
}
